package exercise;

import java.util.Scanner;

/*
a.将输入的任意0-999的整数全部补全为三位数输出(不足三位补0)
 */
public class ex1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入任意0-999整数：");
            int num = sc.nextInt();
            System.out.println(solve(num));
        }
    }
    private static String solve(int num) {
        StringBuilder sb = new StringBuilder();
        sb.append(num);

        while (sb.length() < 3) sb.insert(0, "0");
        return sb.toString();

    }
}
